package cn.itsource.hrm.document;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "hrm", type = "course")
@AllArgsConstructor
@NoArgsConstructor
public class CourseDoc {

    @Id
    private Long id;                  //": 5,
    
    @Field( type =FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String name;//       ": "H5大神班",
    
    @Field(type = FieldType.Keyword)
    private String forUser;//           ": "小白",

    @Field(type = FieldType.Long)
    private Long courseTypeId;//           ": 1039,
    
    @Field(type = FieldType.Keyword) 
    private String gradeName;//           ": "白银",
    @Field(type = FieldType.Long)
    private Long gradeId;//           ": 3,
    
    
    @Field(type = FieldType.Long)
    private Long tenantId;//                ": 26,
    @Field(type = FieldType.Keyword)
    private String tenantName;//           ": "源码时代",
    
    
    
    @Field(type = FieldType.Keyword)
    private String pic;//               ": "https://test0831.oss-cn-chengdu.aliyuncs.com/itsource/1ddb643a-8603-469d-b934-acdfcc81384c_9.jpg",
    @Field(type = FieldType.Integer)
    private Integer viewCount;//    人气                    ": 11222,
    @Field(type = FieldType.Date) // 课程上线时间
    private Date onLineTime;//           ": 1570934805000,


    @Field(type = FieldType.Keyword)
    private String chargeName;//           ": "收费",

    @Field(type = FieldType.Float)
    private Float price;//           ": 100,
    @Field(type = FieldType.Float)
    private Float priceOld;//           ": 200,
    
}
